Skip to content

feat(ios): status and progress toasts, notifications row - #1101

Open
kyya wants to merge 8 commits into
mainfrom
feat/ios-toast
Open

kyya wants to merge 8 commits into
mainfrom
feat/ios-toast

Conversation

@kyya

@kyya kyya commented Nov 24, 2026 •

Copy link
Copy Markdown

Refs #1095

Problem

Rex Go tells the user that their own action failed with a modal alert that has only an OK button, for example "Can't Split the Pane". The alert stops the work, and there is nothing to decide. An upload shows only a spinner on the key bar, says nothing when it succeeds, and a failure is a modal alert with no way to retry. When notifications are off, the app says nothing.

Change

Design doc: docs/IOS-024-toasts.md.

  • Toast host (ios/GoRex/Views/Toast.swift). The app shows one toast at a time, as a glass capsule at the top centre, over every screen. In a terminal it shows at the bottom centre instead, above the key bar and the pane bar, where the Reconnecting note shows, so it does not cover the terminal's header. Only the latest screen with a toast host shows it: a sheet over a terminal, a terminal over the list. Kinds: status (with an error variant), progress (it turns into its result in the same place). VoiceOver announces each toast once, and the toast never takes focus. Under Reduce Motion it cross-fades in 150 ms. Swipe it toward its edge to dismiss it.
  • I4: the "Can't …" alerts with only OK in HostSection.swift, TerminalScreen.swift and HostListView.swift are error toasts now. The alerts that offer a fix stay alerts, for example Folder Not Found with Close Project.
  • I5: an upload shows "Uploading " (or "Uploading N files"), then "Uploaded". A failure shows the error with Retry, which stays until used or closed. Retry sends only the files that were not sent yet. "Uploaded to " is not built: the upload stream does not return a path (see "Open" below).
  • G4: Settings has a Notifications row. It shows whether notifications are on, and it asks for permission or opens the Settings app.

Delete Space keeps its confirm alert, by the owner's decision: this PR adds no Undo for it.

Open

The upload stream (upload_begin, startUploadStream in internal/rexapi/upload.go) returns no path, so the toast cannot name the folder. The upload stream is part of the wire protocol, and docs/irreversible.md asks for an owner decision before a change to it.

Test

  • New unit tests (not run here, Linux): ToastTests (lifetimes, a stale timer is ignored, a result is announced when nothing shows, progress settles, Retry stays, sheet hosts hide the root), UploadTests.testRetrySendsOnlyTheUnsent.
  • NOT VERIFIED here: the Swift was not compiled, because this machine has no Xcode. The ios-test workflow builds it and runs the tests on the Mac mini.

Screenshots

iPhone 17 simulator (iOS 27.0) against a real gorex server + rexapi gateway on the Mac mini (demo mode cannot upload). Before: the merge-base 0a8bb00; after: this branch, same steps in one throwaway XCUITest. The failure shots kill the session mid-upload, which is why "The tab closed." sits behind the alert/toast.

Before After
Settings — Notifications row
Upload done
Upload failed

The "Uploading N files" progress toast is not captured: 180 MB clears a loopback stream in seconds, so every shot lands after it settled. The Settings row shows the notDetermined "Turn On" state; the denied ("Open Settings" + footer) and on ("On") states are not covered.

Verified: go run ./tools/verify: design docs passed; ios xcodebuild NOT VERIFIED here (no Xcode); the iOS test workflow run is linked in a comment

@kyya

kyya commented Nov 24, 2026

Copy link
Copy Markdown
Author

iOS build and unit tests: the first ios-test run failed to compile (Toast.swift:78: the scheduler closure lost its @MainActor). Commit "fix(ios): keep the toast scheduler on the main actor" fixes it, and ios-test run 45468178388 passed (build and GoRexTests, including ToastTests, PendingSpaceTests and UploadTests).

No screenshots: the simulator runs only on the Mac mini, and the owner said iOS shots may be skipped.

@kyya kyya changed the title feat(ios): status, progress and undo toasts, notifications row feat(ios): status and progress toasts, notifications row Nov 25, 2026
kyya added 5 commits November 25, 2026 07:58
IOS-023 went to the SSH hosts doc on main (#1121).
…eader

In a terminal the toast covered the title capsule. It now shows at the bottom, where the Reconnecting note shows, and the top shows none. Only the latest screen with a toast host shows the toast: a sheet over a terminal, a terminal over the list.
@kyya

kyya commented Nov 25, 2026

Copy link
Copy Markdown
Author

In a terminal, the toast now shows above the key bar, where the Reconnecting note shows, not over the header. iOS test on 3b9e131: https://github.com/si-mods/gorex/actions/runs/45577800169 (passed). Two earlier runs failed only because the shared DerivedData on the Mac mini held a Tailnet module built from another go.sum; merging main fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant